using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using Bymed.SpineScan.DataModel;
using Bymed.SpineScan.Repository.EntityFramework.Mapping;

namespace Bymed.SpineScan.Repository.EntityFramework
{
    public partial class SpineScanContext : DbContext
    {
        static SpineScanContext()
        {
            Database.SetInitializer<SpineScanContext>(null);
        }

        public SpineScanContext()
            : base("Name=SpineScanContext")
        {
        }

        public DbSet<AttendingDoctor> AttendingDoctors { get; set; }
        public DbSet<CustomizedTestItem> CustomizedTestItems { get; set; }
        public DbSet<DiagnosticMessageReference> DiagnosticMessageReferences { get; set; }
        public DbSet<Patient> Patients { get; set; }
        public DbSet<TestResult> TestResults { get; set; }
        public DbSet<TestResultDiagnosticMessage> TestResultDiagnosticMessages { get; set; }
        public DbSet<TestTracking> TestTrackings { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new AttendingDoctorMap());
            modelBuilder.Configurations.Add(new CustomizedTestItemMap());
            modelBuilder.Configurations.Add(new DiagnosticMessageReferenceMap());
            modelBuilder.Configurations.Add(new PatientMap());
            modelBuilder.Configurations.Add(new TestResultMap());
            modelBuilder.Configurations.Add(new TestResultDiagnosticMessageMap());
            modelBuilder.Configurations.Add(new TestTrackingMap());
        }
    }
}
